<script>on mouseUpglobal quartSecs------------------------------------------1ST Quarter--------------------repeatask "Enter the date that starts the 1st quarter of a specific year on line 1."&return&return&"Enter the ending date for the 1st quarter on line 2."&return&return&¬"It must be a date (preferably from a leap year) in a form that Hypercard can read. Only hit the return key to enter the dates."with"12/1/91"&return&"2/29/92"if line 1 of it is empty or line 2 of it is empty thendateNotTherenext repeatend ifif line 1 of it is a date and line 2 of it is a date thenconvert line 1 of it to secondsconvert line 2 of it to secondsif line 2 of it - line 1 of it > 8985600 thendateTooLongnext repeatend ifif line 2 of it - line 1 of it < 7257600 thendateTooShortnext repeatend ifelsedateNoGoodnext repeatend ifput line 1 of it into enteredDateput ","&line 2 of it after enteredDateconvert line 1 of it to long dateconvert line 2 of it to long datedelete item 1 of line 1 of itdelete item 1 of line 2 of itanswer "Please check this statement:"&return&return&"The first quarter starts:"&return&line 1 of it&return&return&"...and ends:"&return&line 2 of it with "false" or "true"if it is "true" then exit repeatend repeat------------------------------------------2ND Quarter--------------------repeatask "Enter the date that starts the 2nd quarter on line 1."&return&return&"Enter the ending date for the 2nd quarter on line 2."&return&return&¬"Remember to only hit the return key when you are ready to enter the dates."with "3/1/92"&return&"5/31/92"if line 1 of it is empty or line 2 of it is empty thendateNotTherenext repeatend ifif line 1 of it is a date and line 2 of it is a date thenconvert line 1 of it to secondsconvert line 2 of it to secondsif line 2 of it - line 1 of it > 8985600 thendateTooLongnext repeatend ifif line 2 of it - line 1 of it < 7257600 thendateTooShortnext repeatend ifelsedateNoGoodnext repeatend ifput ","&line 1 of it after enteredDateput ","&line 2 of it after enteredDateconvert line 1 of it to long dateconvert line 2 of it to long datedelete item 1 of line 1 of itdelete item 1 of line 2 of itanswer "Please check this statement:"&return&return&"The second quarter starts: "&return&line 1 of it&return&return&"...and ends: "&return&line 2 of it with "false" or "true"if it is true then exit repeatend repeat------------------------------------------3rd Quarter--------------------repeatask "Enter the date that starts the 3rd quarter on line 1."&return&return&"Enter the ending date for the 3rd quarter on line 2."&return&return&¬"Remember to only hit the return key when you are ready to enter the dates."with "6/1/92"&return&"8/31/92"if line 1 of it is empty or line 2 of it is empty thendateNotTherenext repeatend ifif line 1 of it is a date and line 2 of it is a date thenconvert line 1 of it to secondsconvert line 2 of it to secondsif line 2 of it - line 1 of it > 8985600 thendateTooLongnext repeatend ifif line 2 of it - line 1 of it < 7257600 thendateTooShortnext repeatend ifelsedateNoGoodnext repeatend ifput ","&line 1 of it after enteredDateput ","&line 2 of it after enteredDateconvert line 1 of it to long dateconvert line 2 of it to long datedelete item 1 of line 1 of itdelete item 1 of line 2 of itanswer "Please check this statement:"&return&return&"The third quarter starts:"&return&line 1 of it&return&return&"...and ends:"&return&line 2 of it with "false" or "true"if it is true then exit repeatend repeat------------------------------------------4th Quarter--------------------repeatask "Enter the date that starts the 4th quarter on line 1."&return&return&"Enter the ending date for the 4th quarter on line 2."&return&return&¬"Remember to only hit the return key when you are ready to enter the dates."with "9/1/92"&return&"11/30/92"if line 1 of it is empty or line 2 of it is empty thendateNotTherenext repeatend ifif line 1 of it is a date and line 2 of it is a date thenconvert line 1 of it to secondsconvert line 2 of it to secondsif line 2 of it - line 1 of it > 8985600 thendateTooLongnext repeatend ifif line 2 of it - line 1 of it < 7257600 thendateTooShortnext repeatend ifelsedateNoGoodnext repeatend ifput ","&line 1 of it after enteredDateput ","&line 2 of it after enteredDateconvert line 1 of it to long dateconvert line 2 of it to long datedelete item 1 of line 1 of itdelete item 1 of line 2 of itanswer "Please check this statement:"&return&return&"The fourth quarter starts:"&return&line 1 of it&return&return&"...and ends:"&return&line 2 of it with "false" or "true"if it is "true" then exit repeatend repeat----------------------------------------Final Check -----------------------if item 4 of enteredDate-item 1 of enteredDate>31622400 thenanswer "Dates entered reflected a four quarter period that was greater than 366 days."&return&return&"If you need to change the quarterly dates you'll need to try"&¬" again. Please be careful next time that the dates entered are for a period not over than 365 days."exit mouseUpend ifrepeat with i = 1 to 8convert item i of enteredDate to daterepeat until last char of item i of enteredDate = "/"delete last char of item i of enteredDateend repeatdelete last char of item i of enteredDateend repeatput item 1 of enteredDate &" - "& item 2 of enteredDate into line 1 of cd fld infodates2put item 3 of enteredDate &" - "& item 4 of enteredDate into line 2 of cd fld infodates2put item 5 of enteredDate &" - "& item 6 of enteredDate into line 1 of cd fld infodates4put item 7 of enteredDate &" - "& item 8 of enteredDate into line 2 of cd fld infodates4answer "This is the final check. In the window below you see the periods that delineate the four quarters for an unspecified year."&return&return&¬"If the dates are correct the program will be reset to reflect the quarter periods you have entered."&return&return&"Otherwise try again." with "try again" or "OK"if it is "try again" thensend mouseUp to bg button "reset quarterly dates"exit mouseUpend ifset the cursor to "busy"repeat with i = 1 to 8put "/92" after last char of item i of enteredDateconvert item i of enteredDate to secondsend repeatsubtract 1 from item 1 of enteredDatesubtract 1 from item 3 of enteredDatesubtract 1 from item 5 of enteredDatesubtract 1 from item 7 of enteredDateadd 1 to item 2 of enteredDateadd 1 to item 4 of enteredDateadd 1 to item 6 of enteredDateadd 1 to item 8 of enteredDateif item 4 of enteredDate = 2808604801 and item 5 of enteredDate = 2777068799 thenanswer "Uh oh... Who'da guessed it!"&return&return&"This is the only date this program isn't ready to handle (the fiscal year 6 months to the day ahead "&¬"of the calendar year). Please contact me if this is really necessary."&return&return&"(hmm...could you shift each quarter over by one day?) "send mouseUp to bg button "reset quarterly dates"exit mouseUpend ifput enteredDate into cd fld "quarterseconds"put empty into quartSecs --clear global variableput enteredDate into quartSecs --new parameters for global variablesend mouseUp to cd button "hide quarters"answer "The program has been reset."set cursor to 1end mouseUpon dateNotThereanswer "That answer was incomplete."&return&return&"If you need to stop at this time (or start all over) choose ""e&"cancel""e&¬" and the default dates (valid in N.Y.S.) will be in effect."&return&return&"If you need to just re-do the fourth quarter entry, choose ""e&"continue""e&"." with "cancel" or "continue"if it is "cancel" then exit to Hypercardend dateNotThereon dateTooShortanswer "A quarter really shouldn't be shorter then about 3 months."&return&return&"Check your response carefully before entering it." --12 weeksend dateTooShorton dateTooLonganswer "A quarter really shouldn't be longer than about 3 months."&return&return&"Your response was a bit longer than that." --14.87 weeksend dateTooLongon dateNoGoodanswer "Please enter the dates again."&return&return&"At least one of your responses was not a valid date."end dateNoGood</script>